#include "link.h"
int main()
{
	//1、创建单链表
	Plink L=creare();
	//2、头插法
#if 0
	int x;
	printf("请输入学生个数：");
	scanf("%d",&x);
	getchar();
	for(int i=0;i<x;i++)
	{
		student arr1;
		printf("请输入第%d个学生学号：",i+1);
		scanf("%d",&arr1.id);
		getchar();
		printf("请输入第%d个学生姓名：",i+1);
		scanf("%s",arr1.name);
		getchar();
		printf("请输入第%d个学生成绩：",i+1);
		scanf("%f",&arr1.transcript);
		getchar();
		front_insert(L,arr1);
	}
#endif
	student arr1[5]=
	{
		{1003,"张三",95.678},
		{1007,"李四",94.999},
		{1002,"王五",98.001},
		{1009,"赵三",91.372},
		{1005,"孙六",91.999}
	};
	for(int i=0;i<5;i++)
		front_insert(L,arr1[i]);
	printf("插入完成\n");
	output_link(L);
	//任意位置插入
	anypos_insert(L,arr1[3],5);
	output_link(L);
	//任意位置删除
	anypos_delete(L,5);
	output_link(L);
	//逆置
	link_re(L);
	output_link(L);
	//排序
	popul_sort(L);
	output_link(L);
	return 0;
}
